﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:localDatePicker="clr-namespace:SLControlLibrary.Resources.Controls.Calendar.DatePicker"
    xmlns:localButtons="clr-namespace:SLControlLibrary.Resources.Controls.Calendar.Buttons"
    xmlns:localCalendar="clr-namespace:SLControlLibrary.Resources.Controls.Calendar.ClassicCalendar">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/SLControlLibrary;component/Resources.Styles/ButtonStyles.xaml" />
    </ResourceDictionary.MergedDictionaries>
    
    <!-- Date Picker -->
    <Style TargetType="localDatePicker:ucDatePicker">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="localDatePicker:ucDatePicker">
                    <Grid Height="Auto"
                          Width="Auto" 
                          Background="{TemplateBinding Background}">

                        <Grid.RowDefinitions>
                            <RowDefinition Height="22" />
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <Border
                            Grid.Row="0"
                            BorderBrush="Black"
                            BorderThickness="1"
                            HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
                            Width="{TemplateBinding Width}"
                            Height="{TemplateBinding Height}">

                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="87" />
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <TextBlock 
                                   x:Name="tbDisplay"
                                   Grid.Column="0"
                                   Text="{TemplateBinding Value}"
                                   TextAlignment="Center"
                                   VerticalAlignment="Center"
                                   HorizontalAlignment="Center"/>

                                <Rectangle
                                    Grid.Column="1"
                                    HorizontalAlignment="Right"
                                    Fill="Green"
                                    Canvas.ZIndex="2"
                                    Cursor="Hand"
                                    Opacity="1" />

                                <Border
                                    Canvas.ZIndex="1"
                                    BorderBrush="Black"
                                    Grid.Column="1"
                                    HorizontalAlignment="Right"
                                    BorderThickness="1,0,0,0"
                                    Background="{TemplateBinding Background}">

                                    <localButtons:ucCalendarButton 
                                        x:Name="btnCalendar"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        ButtonType="Down"
                                        Background="{TemplateBinding Background}"
                                        Width="{TemplateBinding Height}" 
                                        Height="{TemplateBinding Height}"
                                        ButtonFill="Black"
                                        Style="{StaticResource CalendarButtonStyle}"/>
                                </Border>
                            </Grid>
                        </Border>

                        <Border x:Name="brdCalendar"
                                Visibility="Collapsed"
                                HorizontalAlignment="Left"
                                Grid.Row="1">
                            <localCalendar:ucCalendar 
                                x:Name="Calendar"
                                Background="White"
                                DisplayMode="Selection"
                                SelectionMode="Single"
                                DateView="Month"
                                VerticalAlignment="Top"
                                HorizontalAlignment="Center"
                                HeaderForeground="Black"
                                HeaderBackground="White"
                                WeekHeaderForeground="Black"
                                YearForeground="Black"
                                MonthForeground="Black"
                                AllowMonthNavigation="True"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
